﻿#region Using directives

using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Ndo
{
    /// <summary>
    /// 
    /// </summary>
    public static class Box<T> 
        where T : class
    {
        static bool nodegenerate(MemberInfo mi)
        {
            return false;
        }
        public static T From(T target)
        {
            if (target == null)
                return null;
            return (T)CI.Invoke(new object[] { target });
        }
        static Box()
        {
            CI = new DegenerateFactory<T>("Box[" + typeof(T).FullName + "]" + BoxHelper.GetId(), nodegenerate).CI;
        }
        internal static readonly ConstructorInfo CI;
    }

    public interface IBoxed<T>
    {
        T Target { get;}
    }
}
